package com.ruoyi.caigou.api.factory;

import com.ruoyi.caigou.api.RemoteBuyBackReqService;
import com.ruoyi.caigou.api.RemoteBuyOrderService;
import com.ruoyi.caigou.domain.BuyOrder;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.caigou.BuyBackReq;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteBuyOrderFallbackFactory implements FallbackFactory<RemoteBuyOrderService> {


    @Override
    public RemoteBuyOrderService create(Throwable cause) {
        return new RemoteBuyOrderService() {
            @Override
            public R<BuyOrder> getInfoByCode(String code, String source) {
                return R.fail("远程调用失败");
            }

            @Override
            public R<Boolean> innerEdit(BuyOrder buyOrder, String source) {
                return R.fail("远程调用失败");
            }

            @Override
            public R<Boolean> innerEditByCode(BuyOrder buyOrder, String source) {
                return R.fail("远程调用失败");
            }

        };
    }
}
